package cn.tedu.baking.controller;

import cn.tedu.baking.commom.response.JsonResult;
import cn.tedu.baking.pojo.vo.BannerVO;
import cn.tedu.baking.service.IBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("v1/banners")
public class BannerController {
    @Autowired
    IBannerService service;
    @GetMapping("")
    public JsonResult list(){
        List<BannerVO> list=service.list();
        return JsonResult.ok(list);
    }
    @PostMapping("{id}/detele")
    public JsonResult detele(@PathVariable Long id){
        service.delete(id);
        return JsonResult.ok();
    }
}
